﻿namespace Datav.Design.IService
{
    /// <summary>
    /// 图像验证码服务接口
    /// </summary>
    public interface ICaptchaService
    {
        /// <summary>
        /// 获取图像验证码数据
        /// </summary>
        /// <param name="type">验证码类型（0-普通验证码 1-算数计算验证码）</param>
        /// <param name="width">验证码图片宽度</param>
        /// <param name="height">验证码图片高度</param>
        /// <param name="length">验证码字符个数</param>
        /// <param name="pid">验证码唯一ID（由服务端雪花算法生成并返回，验证的时候传回服务端）</param>
        CaptchaResult GetVerifyCode(CaptchaType type = CaptchaType.Normal, int width = 120, int height = 30, int length = 4, long pid = 0);

        /// <summary>
        /// 验证输入的验证码
        /// </summary>
        /// <param name="id">验证码唯一Id</param>
        /// <param name="inputCode">输入的验证码</param>
        (bool Success, string Msg) Validate(long id, string inputCode);
    }
}